/**
 * Copyright 2010 Pavel Daniel Alexandru PFA
 * 
 * Licensed under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation. You may obtain a copy of the
 * License at: http://www.gnu.org/copyleft/lesser.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.kobol.webclient.client.widgets;

import com.allen_sauer.gwt.log.client.Log;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.widgets.Img;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.layout.HLayout;

/**
 * @author Pavel Alexandru
 * 
 */
public class Masthead extends HLayout {

    private static final int MASTHEAD_HEIGHT = 58;

    public Masthead() {
	super();

	Log.debug("Masthead()");

	// initialise the Masthead layout container
	this.setStyleName("crm-Masthead");
	this.setHeight(MASTHEAD_HEIGHT);

	// initialise the Logo image
	Img logo = new Img("logo.png", 48, 48);
	logo.setStyleName("crm-Masthead-Logo");

	// initialise the Name label
	Label name = new Label();
	name.setStyleName("crm-Masthead-Name");
	name.setContents("Kobol Webclient");

	// initialise the West layout container
	HLayout westLayout = new HLayout();
	westLayout.setHeight(MASTHEAD_HEIGHT);
	westLayout.setWidth("50%");
	westLayout.addMember(logo);
	westLayout.addMember(name);

	// initialise the Signed In User label
	Label signedInUser = new Label();
	signedInUser.setStyleName("crm-Masthead-SignedInUser");
	signedInUser.setContents("<b>Alexandru Pavel</b><br />Supervisor");

	// initialise the East layout container
	HLayout eastLayout = new HLayout();
	eastLayout.setAlign(Alignment.RIGHT);
	eastLayout.setHeight(MASTHEAD_HEIGHT);
	eastLayout.setWidth("50%");
	eastLayout.addMember(signedInUser);

	// add the West and East layout containers to the Masthead layout
	// container
	this.addMember(westLayout);
	this.addMember(eastLayout);
    }
}